<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./lib/socket.io.min.js"></script>
</head>
<body>
    <button>发送数据</button>
</body>
<script>
    const btn = document.querySelector("button");
    // 连接服务端
    const ws = io.connect("http://127.0.0.1");
    ws.on("my",function(a,b,c,d){
        console.log("my",a,b,c,d);
    })
    btn.onclick = function(){
        console.log(123);
        ws.emit("info",1,2,3,4);
    }
</script>
</html>